import request from '@/utils/request.js'

//获取材料列表接口
export const getIngredientListAPI = (page, pageSize, name) => {
  return request.get('/admin/ingredient', {
    params: {
      page, // 当前页码
      pageSize, // 每页条数
      name // 材料名称，用于筛选
    }
  })
}

//添加材料接口
export const addIngredientAPI = (data) => {
  return request.post('/admin/ingredient', data)
}

//修改材料接口
export const updateIngredientAPI = (id, name) => {
  return request.put('/admin/ingredient', { id, name })
}

//查看材料详情接口
export const getIngredientDetailAPI = (id) => {
  return request.get(`/admin/ingredient/detail?id=${id}`)
}
